1. Field of the Invention
The invention relates to image compression, and more particularly to an apparatus and a method for image compression.
2. Description of the Related Art
After an image is sampled and quantized by an image acquiring device, such as a charge coupled device (CCD) or a complementary metal-oxide semiconductor (CMOS), a large-sized raw image data file is produced. Such large-sized image data file would result in a slow rate of processing and transmission of the image data file. Data compression technique is thus employed in data processing to save the memory space for storing image data and time for transmission of the image data.
During image compression, a two-dimensional pixel array is taken from raw image data as a data unit for compression, for example, an 8×8, or 16×16, pixel array, instead of a one-dimensional pixel array. However, the image data are transferred to a buffer memory row by row because the data unit for transmission is a row of the image data. In this way, image compression does not begin until eight rows of image data have been transferred to the buffer memory if the data unit for compression is an 8×8, pixel array of the image. In the case of the data unit for compression being a 16×16, pixel array, image compression cannot start until 16, rows of image data have been transferred to the buffer memory. Besides, the buffer memory has to be large enough for temporarily storing eight or 16 rows of image data in view of the above examples. The cost for processing data is then increased due to the requirement for a large-sized buffer memory. Further, it is inefficient to wait for a specific amount of image data before data compression starts. Therefore, a more efficient approach is desirable.